package com.cy.pj.common.service;

import com.cy.pj.common.cache.Cache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service   // 业务注解
public class CacheService {

    private Cache cache;

    @Autowired      // @Autowired 来描述构造方法   （用在构造方法上可以省略）
    // @Qualifier可以修饰：ElementType.FIELD属性, ElementType.METHOD方法, ElementType.PARAMETER参数,
    public CacheService(@Qualifier("softCache") Cache cache){
        this.cache=cache;
        System.out.println("cache="+this.cache);
    }
    //.............
    //..............
}
